Imports Aricie.DNN.Modules.LuceneSearch.Business
Imports Aricie.DNN.UI.WebControls
Imports DotNetNuke.Entities.Modules
Imports Aricie.DNN.UI

Namespace Aricie.DNN.Modules.LuceneSearch.UI.Controls
    Public Class SearchFieldSelector
        Inherits SelectorControl(Of FieldDefinition)


        Private _ModuleId As Integer = -1

        Public Property ModuleId() As Integer
            Get
                If Me._ModuleId = -1 Then
                    Dim moduleBase As PortalModuleBase = GetParentModuleBase(Me)
                    If moduleBase IsNot Nothing Then
                        Me._ModuleId = moduleBase.ModuleId
                    End If
                End If
                Return Me._ModuleId
            End Get
            Set(ByVal value As Integer)
                Me._ModuleId = value
            End Set
        End Property


        Public Overrides Function GetEntitiesG() As IList(Of FieldDefinition)
            Return PortalQueryingDriver.GetCurrent().GetSearchFields(Me.ModuleId)
        End Function
    End Class
End Namespace
